package com.xm;

public class Condition02 {
    public static void main(String[] args) {
        int x = 10;
        int y = 30;

        if (x < 20) {
            System.out.println("这是if语句");
        }

        if (x < 10) {
            System.out.println("这是if...else语句的if分支");
        } else {
            System.out.println("这是if...else语句的else分支");
        }

        if (x == 5) {
            System.out.println("这是if...else if...else语句的if分支");
        } else if (x == 8) {
            System.out.println("这是if...else if...else语句的else if分支");
        } else if (x == 10) {
            System.out.println("这是if...else if...else语句的else if分支");
        } else {
            System.out.println("这是if...else if...else语句的else分支");
        }

        if (x == 10) {
            if (y == 30) {
                System.out.println("if嵌套语句");
            }
        }
    }

}
